/*
 * ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 * <joerg@FreeBSD.ORG> wrote this file.  As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer in return.        Joerg Wunsch
 * ----------------------------------------------------------------------------
 *
 * Simple AVR demonstration.  Controls a LED that can be directly
 * connected from OC1/OC1A to GND.  The brightness of the LED is
 * controlled with the PWM.  After each period of the PWM, the PWM
 * value is either incremented or decremented, that's all.
 *
 * $Id: demo.c 1637 2008-03-17 21:49:41Z joerg_wunsch $
 */

#define F_CPU 1000000UL
#include <avr/sfr_defs.h>
#include <avr/io.h>
#include <util/delay.h>
#include <avr/sleep.h>

int main (void)
{
    PORTC |= _BV(0);
    DDRC = 0x0;
    //PORTE |= _BV(0) | _BV(1);
    PORTE = 0xff;
    DDRE = 0x0;


    DDRC |= _BV(1);
    DDRC |= _BV(0);
    DDRE |= _BV(2);
    //_delay_ms(1000);
    while(1){
        DDRE = 0x0; 
        //_delay_us(20);
        //DDRC &= !_BV(0);

        //sdelay_ms(1);
        while(PINC & _BV(1)){
        
        }
        _delay_ms(1000);
        
    }

    return (0);
}

